/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package comparators;

import card.entity.Card;
import java.util.Comparator;

/**
 *
 * @author user
 */
public class SuitComparator implements Comparator {

    public int compare(Object o1, Object o2) {

        Card card1 = (Card) o1;
        Card card2 = (Card) o2;

        int card1SuitId = card1.getCardSuit().getSuitId();
        int card2SuitId = card2.getCardSuit().getSuitId();

        return (card1SuitId > card2SuitId ? -1 : (card1SuitId == card2SuitId ? 0 : 1));

    }
}